<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <meta http-equiv="X-UA-Compatible" content="ie=edge">
    <title>Document</title>
    <style>
        .wrap{
            width: 500px;
            height: 500px;
            background: red;
            position: fixed;
            top: 0;right: 0;bottom: 0;left: 0;
            margin: auto
        }
        .box{
            width: 200px;
            height: 200px;
            background: pink;
            position: absolute;
            left: 50%;top: 50%;
            margin: -100px 0 0 -100px
        }
    </style>
</head>
<body>
    <div class="wrap">
        <div class="box"></div>
    </div>
</body>
</html>